<script type="text/javascript" src="<?=base_url().'resource/js/jquery.cookie.js'?>" charset="utf-8"></script>
<script type="text/javascript" src="<?=base_url().'resource/js/layer/layer.js'?>" charset="utf-8"></script>
<div class="mian" style="width:auto;">
    <div class="mian1">
        <div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left'); ?>
            <!--left end-->
            <!--right start-->
            <div class="right" style="width:440px;">
                <!--breadcrumb start-->
                <div class="righta"><?= $this->breadcrumb->generateHTML(); ?> </div>
                <!--breadcrumb end-->
                <!-- contents start -->
                <div id="contents">
                    <div id="contents_container">
                        <form action="<?= blang_url('files/Filemanage/ajax_update/' . $fileslist[0]['id']) ?>"
                              method="post" name="productform" name="form1" autocomplete="off"
                              id="form1">
                            <table cellpadding="0" cellspacing="0" id="table_forms" border="1">
                                <tr>
                                    <td>文件标题：<input type="text" value="<?= $fileslist[0]['title'] ?>" id="title"
                                                    name="title" style="width: 80%"></td>
                                </tr>

                                <?php if ($filetype) { ?>
                                    <tr>
                                        <td>文件类型：<select name="type" id="type">
                                                <?php foreach ($filetype as $trow): ?>
                                                    <option
                                                        value="<?= $trow['id'] ?>" <?= $fileslist[0]['typeid'] == $trow['id'] ? 'selected' : '' ?>><?= $trow['name'] ?></option>
                                                <?php endforeach ?>
                                            </select></td>
                                    </tr>
                                <?php }
                                else { ?>
                                    <tr style="display:none;">
                                        <td>文件类型：<select name="type" id="type">
                                                <option
                                                    value="<?= $fileslist[0]['typeid'] ?>"><?= $fileslist[0]['typename'] ?></option>
                                            </select></td>
                                    </tr>
                                <?php } ?>


                                <tr>
                                    <td><input type="hidden" name="parentid" id="parentid"
                                               value="<?php echo($parentid); ?>">

                                        <input type="button" value="提交修改" id="subb" style="float:right;"></td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
                <!-- contents end -->
            </div>
            <!--right end-->
            <!--    -->
        </div>
    </div>
</div>
<script type="text/javascript">
    $(".top,.left,.righta").hide();

    $('#subb').click(function () {

        if ($.trim($('#title').val()) == '') {
            layer.msg('亲，标题不能为空哦');
            $('#title').focus();
        } else {
            $('#form1').submit();
        }
    });
</script>